package model

type App struct {
	Version string `mapstructure:"version"`
	Code    string `mapstructure:"appCode"`
	Name    string `mapstructure:"appName"`
	Secret  string `mapstructure:"appSecret"`
}

type ServerConfig struct {
	Port  int      `mapstructure:"port"`
	Name  string   `mapstructure:"name"`
	Proxy []string `mapstructure:"proxy"`
	Mode  string   `mapstructure:"mode"`
}

type LogConfig struct {
	File          string `mapstructure:"file"`
	RotationHours int    `mapstructure:"rotationHours"`
	RotationCount int    `mapstructure:"rotationCount"`
	Level         string `mapstructure:"level"`
	Stdout        bool   `mapstructure:"stdout"`
}

type MysqlConfig struct {
	Server          string `mapstructure:"dbServer"`
	DbName          string `mapstructure:"dbName"`
	User            string `mapstructure:"dbUser"`
	Passwd          string `mapstructure:"dbPass"`
	Port            int    `mapstructure:"dbPort"`
	NetWork         string `mapstructure:"dbNetWork"`
	MaxOpenConns    int    `mapstructure:"maxOpenConns"`
	MaxIdleConns    int    `mapstructure:"maxIdleConns"`
	ConnMaxLifetime int    `mapstructure:"connMaxLifetime"`
}

type RedisConfig struct {
	Addr     string `mapstructure:"addr"`
	Username string `mapstructure:"username"`
	Password string `mapstructure:"password"`
	DB       int    `mapstructure:"db"`

	MasterName       string   `mapstructure:"masterName"`
	SentinelAddrs    []string `mapstructure:"sentinelAddrs"`
	SentinelUsername string   `mapstructure:"sentinelUsername"`
	SentinelPassword string   `mapstructure:"sentinelPassword"`
}
